ACORN PRNG
   HOME

TheInfoList



OR:

The ACORN or ″Additive Congruential Random Number″ generators are a robust family of PRNGs (
pseudorandom number generator A pseudorandom number generator (PRNG), also known as a deterministic random bit generator (DRBG), is an algorithm for generating a sequence of numbers whose properties approximate the properties of sequences of random numbers. The PRNG-generate ...
s) for sequences of uniformly distributed pseudo-random numbers, introduced in 1989 and still valid in 2019, thirty years later. Introduced by R.S.Wikramaratna,Wikramaratna, R.S. (1989). ACORN — A new method for generating sequences of uniformly distributed Pseudo-random Numbers. Journal of Computational Physics. 83. 16-31. ACORN was originally designed for use in
geostatistical Geostatistics is a branch of statistics focusing on spatial or spatiotemporal datasets. Developed originally to predict probability distributions of ore grades for mining operations, it is currently applied in diverse disciplines including petr ...
and
geophysical Geophysics () is a subject of natural science concerned with the physical processes and physical properties of the Earth and its surrounding space environment, and the use of quantitative methods for their analysis. The term ''geophysics'' some ...
Monte Carlo simulations, and later extended for use on
parallel computer Parallel computing is a type of computation in which many calculations or processes are carried out simultaneously. Large problems can often be divided into smaller ones, which can then be solved at the same time. There are several different fo ...
s.R.S. Wikramaratna, Pseudo-random number generation for parallel processing — A splitting approach, SIAM News 33 (9) (2000). Over the ensuing decades, theoretical analysis (formal proof of
convergence Convergence may refer to: Arts and media Literature *''Convergence'' (book series), edited by Ruth Nanda Anshen *Convergence (comics), "Convergence" (comics), two separate story lines published by DC Comics: **A four-part crossover storyline that ...
and statistical results), empirical testing (using standard test suites), and practical application work have continued, despite the appearance and promotion of other better-known ut not necessarily better performingPRNGs.


Benefits

The main advantages of ACORN are simplicity of concept and coding, speed of execution, long period length, and mathematically proven convergence. The algorithm can be extended, if future applications require “better quality” pseudo random numbers and longer period, by increasing the order and the modulus as required. In addition, recent research has shown that the ACORN generators pass all the tests in the TestU01 test suite, current version 1.2.3, with an appropriate choice of parameters and with a few very straightforward constraints on the choice of initialisation; it is worth noting, as pointed out by the authors of TestU01, that some widely-used pseudo-random number generators fail badly on some of the tests . ACORN is particularly simple to implement in exact integer arithmetic, in various computer languages, using only a few lines of code.R.S. Wikramaratna, Theoretical and empirical convergence results for additive congruential random number generators, Journal of Computational and Applied Mathematics (2009), Integer arithmetic is preferred to the real arithmetic modulo 1 in the original presentation, as the algorithm is then reproducible, producing exactly the same sequence on any machine and in any language, and its periodicity is mathematically provable. The ACORN generator has not seen the wide adoption of some other PRNGs, although it is included in the Fortran and
C library The C standard library or libc is the standard library for the C programming language, as specified in the ISO C standard. ISO/IEC (2018). '' ISO/IEC 9899:2018(E): Programming Languages - C §7'' Starting from the original ANSI C standard, it was ...
routines of
NAG Numerical Library The NAG Numerical Library is a software product developed and sold by The Numerical Algorithms Group Ltd. It is a software library of numerical analysis routines, containing more than 1,900 mathematical and statistical algorithms. Areas covered by ...
. Various reasons have been put forward for this. Nevertheless, theoretical and empirica
research
is ongoing to further justify the continuing use of ACORN as a robust and effective PRNG.


Provisos

In testing, ACORN performs extremely well, for appropriate parameters. However in its present form, ACORN has not been shown to be suitable for
cryptography Cryptography, or cryptology (from grc, , translit=kryptós "hidden, secret"; and ''graphein'', "to write", or ''-logia'', "study", respectively), is the practice and study of techniques for secure communication in the presence of adver ...
. There have been few critical appraisals regarding ACORN. One of these, warns of an unsatisfactory configuration of the acorni() routine when using GSLIB GeoStatistical modelling and simulation library,GsLib
An open-source package dedicated to geostatistics, source code in Fortran 77 and 90.
and proposes a simple solution for this issue. Essentially the modulus parameter should be increased in order to avoid this issue. Another brief reference to ACORN simply states that the "... ACORN generator proposed recently is in fact equivalent to a MLCG with matrix A such that a~ = 1 for i 2 j, aq = 0 otherwise" but the analysis is not taken further. ACORN is not the same as ACG (Additive Congruential Generator) and should not be confused with it - ACG appears to have been used for a variant of the LCG (
Linear Congruential Generator A linear congruential generator (LCG) is an algorithm that yields a sequence of pseudo-randomized numbers calculated with a discontinuous piecewise linear equation. The method represents one of the oldest and best-known pseudorandom number generat ...
) described by Knuth (1997).


History and development

Initially, ACORN was implemented in real arithmetic in FORTRAN77, and shown to give better speed of execution and statistical performance than Linear Congruential Generators and Chebyshev Generators. In 1992, further results were published,R.S. Wikramaratna, Theoretical background for the ACORN random number generator, Report AEA-APS-0244, AEA Technology, Winfrith, Dorset, UK, 1992. implementing the ACORN Pseudo-Random Number Generator in exact integer arithmetic which ensures reproducibility across different platforms and languages, and stating that for arbitrary real-precision arithmetic it is possible to prove convergence of the ACORN sequence to k-distributed as the precision increases. In 2000, ACORN was stated to be a special case of a Multiple Recursive Generator (and, therefore, of a Matrix Generator), and this was formally demonstrated in 2008 in a paper which also published results of empirical
Diehard tests The diehard tests are a battery of statistical tests for measuring the quality of a random number generator. They were developed by George Marsaglia over several years and first published in 1995 on a CD-ROM of random numbers. Test overview ; Bi ...
and comparisons with the NAG LCG (
Linear Congruential Generator A linear congruential generator (LCG) is an algorithm that yields a sequence of pseudo-randomized numbers calculated with a discontinuous piecewise linear equation. The method represents one of the oldest and best-known pseudorandom number generat ...
). In 2009,
formal proof In logic and mathematics, a formal proof or derivation is a finite sequence of sentences (called well-formed formulas in the case of a formal language), each of which is an axiom, an assumption, or follows from the preceding sentences in the seq ...
was given of theoretical convergence of ACORN to k-distributed for modulus M=2m as m tends to infinity (as previously alluded to in 1992), together with empirical results supporting this, which showed that ACORN generators are able to pass all the tests in the standard
TESTU01 TestU01 is a software library, implemented in the ANSI C language, that offers a collection of utilities for the empirical randomness testing of random number generators (RNGs).
suite for testing of PRNGs (when appropriate order and modulus parameters are selected). Since 2009 ACORN has been included in the NAG (
Numerical Algorithms Group The NAG Numerical Library is a software product developed and sold by The Numerical Algorithms Group Ltd. It is a software library of numerical analysis routines, containing more than 1,900 mathematical and statistical algorithms. Areas covered ...
) FORTRAN and C library routines, together with other well-known PRNG routines. This implementation of ACORN works for arbitrarily large modulus and order, and is available for researchers to download. ACORN was also implemented in GSLIB GeoStatistical modelling and simulation library. More recently, ACORN was presented in April 2019 at a poster session at a conference on Numerical algorithms for high-performance computational science at the
Royal Society The Royal Society, formally The Royal Society of London for Improving Natural Knowledge, is a learned society and the United Kingdom's national academy of sciences. The society fulfils a number of roles: promoting science and its benefits, re ...
in London, and in June 2019 at a Seminar of the Numerical Analysis Group at the Mathematical Institute of the University of Oxford. where it was stated that statistical performance is better than some very widely used generators (including the Mersenne Twister MT19937) and comparable to the best currently available methods" and that ACORN generators have been shown to reliably pass all the tests in the TestU01, while some other generators including Mersenne Twister do not pass all these tests. The poster and the presentation can be found at.


Code example

The following example in Fortran77 was published in 2008 which includes a discussion of how to initialise : DOUBLE PRECISION FUNCTION ACORNJ(XDUMMY) C C Fortran implementation of ACORN random number generator C of order less than or equal to 120 (higher orders can be C obtained by increasing the parameter value MAXORD) and C modulus less than or equal to 2^60. C C After appropriate initialization of the common block /IACO2/ C each call to ACORNJ generates a single variate drawn from C a uniform distribution over the unit interval. C IMPLICIT DOUBLE PRECISION (A-H,O-Z) PARAMETER (MAXORD=120,MAXOP1=MAXORD+1) COMMON /IACO2/ KORDEJ,MAXJNT,IXV1(MAXOP1),IXV2(MAXOP1) DO 7 I=1,KORDEJ IXV1(I+1)=(IXV1(I+1)+IXV1(I)) IXV2(I+1)=(IXV2(I+1)+IXV2(I)) IF (IXV2(I+1).GE.MAXJNT) THEN IXV2(I+1)=IXV2(I+1)-MAXJNT IXV1(I+1)=IXV1(I+1)+1 ENDIF IF (IXV1(I+1).GE.MAXJNT) IXV1(I+1)=IXV1(I+1)-MAXJNT 7 CONTINUE ACORNJ=(DBLE(IXV1(KORDEJ+1)) 1 +DBLE(IXV2(KORDEJ+1))/MAXJNT)/MAXJNT RETURN END


External links

* : contains information regarding the ACORN concept and algorithm, its author, a complete list of references, and information about current research directions.


References

{{Reflist Random number generation Pseudorandom number generators